package com.dds.system.domain.union;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.dds.common.annotation.Excel;
import com.dds.common.core.domain.BaseEntity;

/**
 * 联盟商家积分商品对象 union_product
 * 
 * @author gaolianjie
 * @date 2021-04-30
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor(staticName = "of",force = true)
public class UnionProduct
{
    private static final long serialVersionUID = 1L;

    /** 自增id */
    private Integer prodId;

    /** 店铺 ID */
    @Excel(name = "店铺 ID")
    private String shopId;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String prodName;

    /** 商品主图 */
    @Excel(name = "商品主图")
    private String prodImage;

    /** 商品说明 */
    @Excel(name = "商品说明")
    private String prodExplain;

    /** 使用规则 待确定 */
    @Excel(name = "使用规则 待确定")
    private String prodRemark;

    /** 购买有效期  */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "购买有效期 ", width = 30, dateFormat = "yyyy-MM-dd")
    private Date purchasePeriod;

    /** 兑换有效期  */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "兑换有效期 ", width = 30, dateFormat = "yyyy-MM-dd")
    private Date exchangePeriod;

    /** 最大可兑换数量  */
    @Excel(name = "最大可兑换数量 ")
    private Integer maxExchangeCount;

    /** 购买所需的积分 */
    @Excel(name = "购买所需的积分")
    private BigDecimal prodScore;

    /** 是否有效 0无效(后台需要审核),1正常,2待审核,3拒绝 */
    @Excel(name = "是否有效 0无效(后台需要审核),1正常,2待审核,3拒绝")
    private String isValid;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /** 创建人员 */
    @Excel(name = "创建人员")
    private String createdUser;

    /** 修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedTime;

    /** 修改人员 */
    @Excel(name = "修改人员")
    private Long updatedUser;

    /** 删除时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date deletedTime;

    /** 预计单份获得金额 */
    @Excel(name = "预计单份获得金额")
    private BigDecimal prodPrice;

    /** 审核描述 */
    @Excel(name = "审核描述")
    private String desc;

    private static final String FAIL = "0";

    private static final String ACCESS = "1";

    private static final String WAIT = "2";

    private static final String REFUSE = "3";

    public static String validText(String valid) {
        switch (valid) {
            case FAIL:
                return "审核状态 => 无效";
            case ACCESS:
                return "审核状态 => 审核通过";
            case WAIT:
                return "审核状态 => 未审核";
            case REFUSE:
                return "审核状态 => 已拒绝";
            default:
                return "未知状态";
        }
    }
}
